package com.bite.demo.ioc;

import com.bite.demo.config.UserConfig;
import com.bite.demo.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class BeanConfig {
    //@Primary
    @Bean
    public UserInfo userInfo1(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(123);
        userInfo.setName("zhangsan");
        return userInfo;
    }
    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(456);
        userInfo.setName("lisi");
        return userInfo;
    }
}
